using System;
using Prism.Mvvm;
using RFS.Domain.PaiShi.Accounting;

namespace RFS.WPF.Views
{
    public class AccItemVm:BindableBase
    {
        #region Remark

        private string _remark;

        private IOrderBasedAccItem _o;
        public  IOrderBasedAccItem DO
        {
            get => _o;
        }  
        
        public AccItemVm(IOrderBasedAccItem orderBasedAccItem)
        {
            

            _o = orderBasedAccItem;
            Date= $"{_o.RelatedOrderItem.BizTime:MM-dd}";
            Remark = $"{_o.Summary}";
            Debit = _o.AmountDebit;
            Credit = _o.AmountCredit;
            BizId = _o.RelatedOrderItem.BizId;
            Left = _o.AmountLeft;
        }

        

        public string Remark
        {
            get { return _remark; }
            set
            {
                _remark = value;
                RaisePropertyChanged(nameof(Remark));
            }
        }

        #endregion


        #region Date

        private String _date;

        public String Date
        {
            get { return _date; }
            set
            {
                _date = value;
                RaisePropertyChanged(nameof(Date));
            }
        }

        #endregion


        #region BizId

        private string _bizId;

        public string BizId
        {
            get { return _bizId; }
            set
            {
                _bizId = value;
                RaisePropertyChanged(nameof(BizId));
            }
        }

        #endregion

        #region Debit

        private Amount _Debit;

        public Amount Debit
        {
            get { return _Debit; }
            set
            {
                _Debit = value;
                RaisePropertyChanged(nameof(Debit));
            }
        }

        #endregion

        #region Credit

        private Amount _Credit;

        public Amount Credit
        {
            get { return _Credit; }
            set
            {
                _Credit = value;
                RaisePropertyChanged(nameof(Credit));
            }
        }

        #endregion

        #region Left

        private Amount _Left=new Amount();

        public Amount Left
        {
            get { return _Left; }
            set
            {
                _Left = value;
                RaisePropertyChanged(nameof(Left));
            }
        }

        #endregion
        
    }
}